home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
comm
/
tribbs20.lha
/
OLP
/
tradewars.lzh
/
Tradewars!
< prev
next >
Wrap
Text File
|
1992-05-23
|
7KB
|
372 lines
/* Tradewars Amiga Version 1.0
Written By Jim Holzknecht
Original Concept By Chris Sherrick
Trinity BBS Amiga Version
Greets To The Jaguar:
Sysop Of The Danger Zone (502)/448-1155 (300-38.4k Baud [HST V.42]) */
options results
bufferflush
getuser 1
name = result
getuser 27
linelength = result
PF = 'olp:TRADEWARS/'
PFP = 'olp:TRADEWARS/players/'
PFU = 'olp:TRADEWARS/universe/'
PFT = 'olp:TRADEWARS/teams/'
space = ' '
date = date('U')
signal on error
signal on syntax
signal on ioerr
transmit '\f1\n1'
if linelength = 80 then do
transmit ' \c6\u1 \u0'
transmit ' \c1\z6 T R A D E W A R S \z0'
end
if linelength ~= 80 then transmit ' \c6\r1 T R A D E W A R S \r0'
transmit '\c2'
an = 'By Jim Holzknecht'
call cnter
an = "(c) 1990,1991 Hokey Software"
call cnter
an = "Modified For Trinity BBS By Rodney Martin"
call cnter
transmit '\c7'
an = 'The Danger Zone (502)/448-1155'
call cnter
mem = storage();if mem<250000 then do
transmit 'Sorry, there is less than 250,000 bytes of memory!'
transmit 'Try again later...'
exit
end
call open file, (PF'autodata.tw'), 'R'
am.1 = readln(file)
am.2 = readln(file)
am.3 = readln(file)
am.4 = readln(file)
am.5 = readln(file)
am.6 = readln(file)
am.7 = readln(file)
call close file
filen = PF'var.tw'
call open file, (filen), 'R'
c.1 = readln(file)
c.2 = readln(file)
call close file
yoopa:
call checkdate
spawn 'olp:twmain'
exit
key:
sendstring '\c6(\c1-*-\c6)\c3'
getchar
transmit '\h9'
return
checkdate:
If exists(PF'date.tw') then do
call open file, (PF'date.tw'), 'R'
tt.1 = readln(file)
call close file
if tt.1 = date('U') then return
end
maint:
transmit '\n1\c6[\c1Now Doing Daily Maintenance\c6]\c3'
dlete:
transmit '\c2Deleting Inactive Players...'
call teloop
ur = 0
x = 0
cop = 0
yoop:
x = x + 1
if x > 40 then signal dlete2
user = PFP'p' x
call open file, (user), 'R'
pl.x.1 = readln(file)
pl.x.2 = readln(file)
pl.x.3 = readln(file)
pl.x.4 = readln(file)
pl.x.5 = readln(file)
pl.x.6 = readln(file)
pl.x.7 = readln(file)
pl.x.8 = readln(file)
pl.x.9 = readln(file)
pl.x.10 = readln(file)
pl.x.11 = readln(file)
pl.x.12 = readln(file)
pl.x.13 = readln(file)
pl.x.14 = readln(file)
pl.x.15 = readln(file)
call close file
signal yoop
dlete2:
cop = cop + 1
if cop > 40 then signal interest
bo = pl.cop.14
if left(pl.cop.1,1) = '.' then bo = 0
if bo = '' then bo = 0
datc = date('c')
temp = left(pl.cop.1,1)
x = datc - bo
if serialn=pl.cop.15 then signal dlete2
if x > am.6 & temp ~= '.' then do
transmit 'Deleting '||trim(pl.cop.1)||'...'
a = pl.cop.1' ['pl.cop.2'] was deleted for inactivity.'
call newspaperopen
if exists(PFU'fighters') then do
call open file, (PFU'fighters'), 'R'
y=0
do until eof(file)
y=y+1
pd.y=readln(file)
if word(pd.y,1)=pl.cop.15 then do
i=y
call cc
end
end
call close file
call searchun
end
pl.cop.3 = 0
pl.cop.4 = 0
pl.cop.7 = 0
pl.cop.15= 0
if pl.cop.2 > 0 then do
teamnumber = pl.cop.2
if tle.teamnumber = pl.cop.1 then do
call disband2
end
end
pl.cop.1 = '..................'
pl.cop.2 = 0
x = cop
call saveuser
if exists(PF''cop) then address command 'delete 'PF''cop
if exists(PF''cop'.msg') then address command 'delete 'PF''cop'.msg'
end
signal dlete2
interest:
c.1 = 5
if am.3 = 1 then do
transmit '\n1Setting Today''s Interest Rate...'
c.1 = random(1,10,time('s'))
end
transmit 'Posting Interest...'
cop = 0
inter:
cop = cop + 1
if cop = 41 then signal interend
if pl.cop.13 > 0 then do
x = pl.cop.13
temp = c.1 / 100
y = trunc(x*temp)
x = x + y
pl.cop.13 = x
x = cop
call saveuser
end
signal inter
interend:
c.2 = 90
if am.4 = 1 then do
transmit '\n1Setting Today''s Cabal Bounty...'
temp = random(1,50,time('s'))
c.2 = 50 + temp
end
fixnewspaper: /* Crazy Cad gets credit here...*/
xx = 30
if xx = 0 then signal done
filen = PF||'paper.tw'
if ~exists(filen) then signal done
call open(short,filen, 'R');s=0
do until eof(short)=1
s=s+1
line.s = readln(short)
end
s=s-1
call close short
if xx ~=0 & xx<s then do
transmit '\c1Fixing Newspaper...'
signal off error
call open(short,filen,'W')
do i =(s-xx+1) to s
writeln(short,line.i)
end
call close short
signal on error
end
if exists(PF'3ALL.msg') then do
address command 'delete 'PF'3ALL.msg'
end
if exists(PF'2ALL.msg') then do
address command 'rename 'PF'2ALL.msg as 'PF'3ALL.msg'
end
if exists(PF'1ALL.msg') then do
address command 'rename 'PF'1ALL.msg as 'PF'2ALL.msg'
end
if exists(PF'cabal') then do
call open file, (PF'cabal')
z = readln(file)
call close file
a = z' Cabal were killed yesterday.'
call newspaperopen
address command 'delete 'PF'cabal'
end
done:
if exists(PF'date.tw') then address command 'delete 'PF'date.tw'
fle = PF'date.tw'
call open file, (fle), 'W'
call writeln file, date('U')
call close file
if exists(PF'var.tw') then address command 'delete 'PF'var.tw'
fle = PF'var.tw'
call open file, (fle), 'W'
call writeln file, c.1
call writeln file, c.2
call close file
endcheck:
return
error:
transmit '\n1Error in Line #' SIGL
exit
syntax:
a = SIGL
transmit '\n1Syntax Error In Line #' a
transmit 'Line Reads : >'sourceline(a)'<'
exit
ioerr:
transmit '\n1I/O Error In Line #' SIGL
exit
saveuser:
call open file, (PFP'p' x), 'W'
call writeln file, pl.x.1
call writeln file, pl.x.2
call writeln file, pl.x.3
call writeln file, pl.x.4
call writeln file, pl.x.5
call writeln file, pl.x.6
call writeln file, pl.x.7
call writeln file, pl.x.8
call writeln file, pl.x.9
call writeln file, pl.x.10
call writeln file, pl.x.11
call writeln file, pl.x.12
call writeln file, pl.x.13
call writeln file, pl.x.14
call writeln file, pl.x.15
call close file
return
cnter:
sendstring center(an,linelength)
return
newspaperopen:
if exists(PF'paper.tw') then do
call close file
call open file, (PF'paper.tw'), 'A'
call writeln file, a
call close file
return
end
call close file
call open file, (PF'paper.tw'), 'W'
call writeln file, a
call close file
return
disband2:
teamnumber = pl.cop.2
transmit '\n1\c5Disbanding Team...'
x = 0
do x = 1 to 40
if pl.x.2 = teamnumber then do
pl.x.2 = 0
call saveuser
end
end
a = tn.teamnumber' disbanded due to the deletion of the captain.'
call newspaperopen
tn.teamnumber = '..'
call saveteam
teloop:
x = 0
teloop2:
x=x+1
if x>10 then return
fle=PFT't' x
call open file, (fle), 'R'
tn.x = readln(file)
tle.x = readln(file)
tpd.x = readln(file)
call close file
signal teloop2
saveteam:
fle = PFT't 'teamnumber
call open file, (fle), 'W'
call writeln file, tn.teamnumber
call writeln file, tle.teamnumber
call writeln file, tpd.teamnumber
call close file
return
searchun:
i=0
searchun2:
i=i+1
if i>y then return
if word(pd.i,1)=pl.cop.15 then do
call removef
i=i-1
end
signal searchun2
cc:
sector=word(pd.i,2)
call open(sctor,PFU'tws'sector, 'R')
do yop=1 to 26
sd.yop=readln(sctor)
end
call close(sctor)
sd.9=99
call open(sctor,PFU'tws'sector, 'W')
do yop=1 to 26
call writeln(sctor, sd.yop)
end
call close(sctor)
return
removef:
z=0
removef2:
z=z+1
temp=y+1
if z=temp then signal removef3
temp=i+z
an=i+z-1
pd.an=pd.temp
signal removef2
removef3:
y=y-2
call open file, (PFU'fighters'), 'W'
do z=1 to y
call writeln file, pd.z
end
call close file
return